<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:composite="http://java.sun.com/jsf/composite"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:s="http://jboss.org/schema/seam/taglib">

<composite:interface>
  <composite:attribute name="value" type="org.zanata.model.Activity"
    shortDescription="activity" required="true"/>

  <composite:attribute name="hideInfo" type="java.lang.Boolean"
    shortDescription="add 'reveal__target' class to information which will be hidden by default"
    default="false"/>
</composite:interface>

<composite:implementation>
  <p class="l--float-right txt--neutral l--push-left-half">
    <s:fragment
      rendered="#{cc.attrs.value.activityType == 'UPDATE_TRANSLATION'}">
      <i aria-hidden="true" class="i--large i--translate"
        title="#{msgs['jsf.Translation']}"></i>
      <span class="is-invisible">#{msgs['jsf.Translation']}</span>
    </s:fragment>

    <s:fragment
      rendered="#{cc.attrs.value.activityType == 'REVIEWED_TRANSLATION'}">
      <i aria-hidden="true" class="i--large i--review"
        title="#{msgs['jsf.Reviewed']}"></i>
      <span class="is-invisible">#{msgs['jsf.Reviewed']}</span>
    </s:fragment>

    <s:fragment
      rendered="#{cc.attrs.value.activityType == 'UPLOAD_SOURCE_DOCUMENT'}">
      <i aria-hidden="true" class="i--large i--document"
        title="#{msgs['jsf.UploadedSource']}"></i>
      <span
        class="is-invisible">#{msgs['jsf.UploadSource']}</span>
    </s:fragment>

    <s:fragment
      rendered="#{cc.attrs.value.activityType == 'UPLOAD_TRANSLATION_DOCUMENT'}">
      <i aria-hidden="true" class="i--large i--translate-up"
        title="#{msgs['jsf.UploadedTranslations']}"></i>
      <span
        class="is-invisible">#{msgs['jsf.UploadedTranslation']}</span>
    </s:fragment>
  </p>

  <p class="l--push-all-0">
    <s:fragment
      rendered="#{cc.attrs.value.activityType == 'UPDATE_TRANSLATION'}">
      You translated
      <strong>#{activityEntry.getWordsCountMessage(cc.attrs.value.wordCount)}</strong> in
      <a
        href="#{activityEntry.getProjectUrl(cc.attrs.value)}">#{activityEntry.getProjectName(cc.attrs.value)}</a>,
      finishing on "<a
      href="#{activityEntry.getEditorUrl(cc.attrs.value)}">#{activityEntry.getLastTextFlowContent(cc.attrs.value)}</a>"
    </s:fragment>

    <s:fragment
      rendered="#{cc.attrs.value.activityType == 'REVIEWED_TRANSLATION'}">
      You reviewed
      <strong>#{activityEntry.getWordsCountMessage(cc.attrs.value.wordCount)}</strong> in
      <a
        href="#{activityEntry.getProjectUrl(cc.attrs.value)}">#{activityEntry.getProjectName(cc.attrs.value)}</a>,
      finishing on "<a
      href="#{activityEntry.getEditorUrl(cc.attrs.value)}">#{activityEntry.getLastTextFlowContent(cc.attrs.value)}</a>"
    </s:fragment>

    <s:fragment
      rendered="#{cc.attrs.value.activityType == 'UPLOAD_SOURCE_DOCUMENT'}">
      You uploaded source documents of
      <strong>#{activityEntry.getWordsCountMessage(cc.attrs.value.wordCount)}</strong> to
      <a
        href="#{activityEntry.getProjectUrl(cc.attrs.value)}">#{activityEntry.getProjectName(cc.attrs.value)}</a>
    </s:fragment>

    <s:fragment
      rendered="#{cc.attrs.value.activityType == 'UPLOAD_TRANSLATION_DOCUMENT'}">
      You uploaded translations of
      <strong>#{activityEntry.getWordsCountMessage(cc.attrs.value.wordCount)}</strong> to
      <a
        href="#{activityEntry.getProjectUrl(cc.attrs.value)}">#{activityEntry.getProjectName(cc.attrs.value)}</a>
    </s:fragment>
  </p>

  <ul class="list--horizontal txt--meta">
    <li>
      <i aria-hidden="true" class="i i--clock txt--neutral"
        title="#{msgs['jsf.Time']}"></i>
      <span
        class="is-invisible">#{msgs['jsf.Time']}</span>#{activityEntry.getHowLongAgoDescription(cc.attrs.value)}
    </li>
    <ui:param name="docName"
      value="#{activityEntry.getDocumentName(cc.attrs.value)}"/>
    <s:fragment rendered="#{docName != null and !docName.isEmpty()}">
      <li class="#{cc.attrs.hideInfo ? 'reveal__target': ''}">
        <i aria-hidden="true" class="i i--document txt--neutral"
          title="#{msgs['jsf.Document']}"></i>
        <span class="is-invisible">#{msgs['jsf.Document']}</span>
        <a
          href="#{activityEntry.getDocumentUrl(cc.attrs.value)}">#{docName}</a>
      </li>
    </s:fragment>
    <ui:param name="languageName"
      value="#{activityEntry.getLanguageName(cc.attrs.value)}"/>
    <s:fragment
      rendered="#{languageName != null and !languageName.isEmpty()}">
      <li class="#{cc.attrs.hideInfo ? 'reveal__target': ''}">
        <i aria-hidden="true" class="i i--language txt--neutral"
          title="#{msgs['jsf.Language']}"></i>
        <span class="is-invisible">#{msgs['jsf.Language']}</span>
        <a
          href="#{activityEntry.getDocumentListUrl(cc.attrs.value)}">#{languageName}</a>
      </li>
    </s:fragment>
    <ui:param name="versionName"
      value="#{activityEntry.getVersionName(cc.attrs.value)}"/>
    <s:fragment
      rendered="#{versionName != null and !versionName.isEmpty()}">
      <li class="#{cc.attrs.hideInfo ? 'reveal__target': ''}">
        <i aria-hidden="true" class="i i--version txt--neutral"
          title="#{msgs['jsf.Version']}">
          <span class="is-invisible">#{msgs['jsf.Version']}</span>
        </i>
        <a
          href="#{activityEntry.getVersionUrl(cc.attrs.value)}">#{versionName}</a>
      </li>
    </s:fragment>
  </ul>
</composite:implementation>
</html>
